#pragma once

#include "ComponentBase.h"
#include <QMap>

class DataBasePrivate;

class DataBase : public ComponentBase
{
	Q_OBJECT

public:
	DataBase(QObject* parent);
	~DataBase();

	bool ReadData(const QString& table, const int id, QStringList& data);


	// 组件初始化处理函数
	virtual int ComponentInit() override;
	/*自检接口*/
	virtual bool ComponentCheckSelfState() override;
	/*复位接口*/
	virtual bool ComponentSelfReset() override;
	// 命令执行接口
	virtual bool ExcuteCmd(int cmd, const QByteArray& input, QByteArray& output) override;

	virtual void ResponseSystemState(int state) override;

private:
	DataBasePrivate* m_db = nullptr;

	QMap<QString, QMap<int, QByteArray>> m_data;
};
